import { get,post,upload } from '@/api/method'
const _defaultLoading = {
    _loading: true,
}
export default {
    //1.正在销售列表 和 已下架列表接口:
    //获取ebay平台站点
    getSite(params){return get('/index/common/sites', params, _defaultLoading)},

    //获取ebay平台,站点分类
    getSiteCate(params){return get('/index/common/categories',params)},

    //搜索站点分类
    searchCate(params){return get('/ebay/category/search-cate',params)},

    //获取销售账号
    getAccounts(params){return get('/index/common/accounts',params)},

    //获取国家 选项
    getCountries(params){return get('/index/common/countries',params)},

    //获取平台可选标签
    getTags(params){return get('/index/common/tags',params)},

    //获取用户
    getUsers(params){return get('/index/common/users',params)},
    
    //ebay 在线listing查询  列表
    getOnlineListing(params){return get('/ebay/goods/index-new',params,_defaultLoading)},

    //列表中,修改标题,检查title
    checkTitle(params){return post('/ebay/selling-listing-batch/check-title',params)},

    //列表中,修改单个标题
    updateSingleTitle(params){return post('/ebay/selling-listing-batch/update-title-single',params,_defaultLoading)},

    //获取修改价格相关数据
    getAutoPrice(params){return post('/ebay/goods/get-auto-price',params)},

    //列表中,提交修改的单个价格信息
    updatePriceWithOffer(params){return post('/ebay/selling-listing-batch/update-price-with-offer',params,_defaultLoading)},

    //列表中,variation多属性展开行,修改单个价格
    updatePrice(params){return post('/ebay/selling-listing-batch/update-price',params,_defaultLoading)},

    //列表中,提交修改的单个库存数量
    updateQuantity(params){return post('/ebay/selling-listing-batch/update-quantity',params,_defaultLoading)},

    //列表中,提交修改的单个备注
    modifySingleRemark(params){return post('/ebay/goods/modify-remark',params)},

    //导入listing,点击开始导入文件
    importSku(params){return upload('/ebay/listing-import/import-sku',params)},

    //导入文件后,弹出继续填写相关信息框,获取站点分类层级数据
    getCateBySelectLink(params){return get('/ebay/goods/get-cate-by-select-link',params,_defaultLoading)},

    //继续填写相关信息框里选择,站点分类到最后一级 获取对应的条件框
    getOtherfeatures(params){return post('ebay/listing-import/get-product-props-html-and-features',params)},

    //继续填写相关信息框里,点击提交,导入listing
    listingImport(params){return post('/ebay/listing-import/store-queue',params)},

    //标签管理,选中的listing
    updataTags(params){return post('/ebay/goods/update-listing-tag',params,_defaultLoading)},

    //标签管理,当天列表所有的listing
    updataTags_bySearch(params){return post('/ebay/goods/async-update-listing-tag-by-search',params,_defaultLoading)},

    //批量修改备注
    modifyRemarks(params){return post('/ebay/goods/modify-remark',params,_defaultLoading)},

    //点击下架提交
    unshelve(params){return post('/ebay/selling-listing-batch/unshelve',params,_defaultLoading)},

    //点击批量修改价格/数量,弹框
    //获取修改价格相关数据 getAutoPrice(params){return post('/ebay/goods/get-auto-price',params)},
    //可输入sku搜索相关数据
    //点提交,更新价格数量(还要验证:价格>自动接受的最低价>自动谢绝的最高价,价格不能为0)
    updatePriceQuantity(params){return post('/ebay/selling-listing-batch/update-price-and-quantity',params,_defaultLoading)},

    //点击批量修改描述内容 
    //1.搜索sku 获取描述内容,富文本编辑器内容赋值
    getDescBySku(params){return get('/ebay/listing-batch/get-desc-by-sku',params,_defaultLoading)},
    //2.提交的修改的描述内容
    batchUpdateDesc(params){return post('/ebay/listing-batch/batch-update-desc',params,_defaultLoading)},

    //点击批量修改描述模板
    //列表全部数据,先判断
    isSamesite_with_account(params){return post('/ebay/goods/is-search-same-site-with-the-same-account',params)},

    //1. 先判断勾选列表listing  是否为相同站点,相同销售账号
    //2. 获取描述模板的选项
    getTpl(params){return post('/ebay/all-template/get-tpl',params)},
    //3. 提交所选模板, 模板是单选,必选
    updateDescTpl(params){return post('/ebay/selling-listing-batch/update-desc-tpl',params,_defaultLoading)},  //勾选的listing
    updateDescTpl_bysearch(params){return post('/ebay/goods/async-update-listing-desc-tpl-by-search',params,_defaultLoading)}, //列表所有的listing

    //点击批量修改运输模板
    //1. 先判断勾选列表listing  是否为相同站点,相同销售账号
    //2. 获取描述模板的选项
    //3. 提交所选模板, 模板是单选,必选
    updateShippingTpl(params){return post('/ebay/selling-listing-batch/update-shipping-tpl',params,_defaultLoading)},
    updateTransTpl_bysearch(params){return post('/ebay/goods/async-update-listing-shipping-tpl-by-search',params,_defaultLoading)}, //列表所有的listing
    

    //点击批量修改退货模板
    //1. 先判断勾选列表listing  是否为相同站点,相同销售账号
    //2. 获取描述模板的选项
    //3. 提交所选模板, 模板是单选,必选
    updateReturnTpl(params){return post('/ebay/selling-listing-batch/update-return-tpl',params,_defaultLoading)},
    updateReturnTpl_bysearch(params){return post('/ebay/goods/async-update-listing-return-tpl-by-search',params,_defaultLoading)}, //列表所有的listing

    //点击批量修改收款模板
    //1. 先判断勾选列表listing  是否为相同站点,相同销售账号
    //2. 获取描述模板的选项
    //3. 提交所选模板, 模板是单选,必选
    updatePaymentTpl(params){return post('/ebay/selling-listing-batch/update-payment-tpl',params,_defaultLoading)},
    updatePayment_bysearch(params){return post('/ebay/goods/async-update-listing-payment-tpl-by-search',params,_defaultLoading)}, //列表所有的listing

    //批量修改标题
    batchUpdateTitle(params){return post('/ebay/selling-listing-batch/update-title',params,_defaultLoading)},

    //拉取item
    pullItem(params){return post('/ebay/api/pull-item',params,_defaultLoading)},

    //获取导出记录,勾选的选项
    getExportMemory(){return get('/ebay/listing-export/get-memory')},

    //提交,导出结果
    exportListing(params){return post('/ebay/listing-export/export',params)},

    //获取违规item的信息 require product  hover事件获取Tooltip
    getListingViolations(params){return get('/ebay/listing-violations/get-listing-violations',params)},

    //已下架列表,重新刊登lisitng  relist
    relist(params){return post('/ebay/goods/relist',params)},

    //获取tab草稿箱,正在销售,已下架,循环拍卖的 listing总条数
    getListNum(params){return get('/ebay/goods/index-new-total',params)},



    //2.草稿箱列表页:-----------------------------------------------------------------------------------------------------------
    //草稿箱列表接口
    getDraftTable(params){return get('/ebay/goods/local-listing-new',params,_defaultLoading)},
    //批量修改备注
    batchDraftRemark(params){return post('/ebay/goods/modify-draft-remark',params)},   //contentNew,localListingIds[]

    //批量修改价格和数量,获取原数据
    getDraftAutoPrice(params){return post('/ebay/draft-listing-batch/get-auto-price',params)},  //local_listing_ids[]

    //批量提交,修改价格数量,commit
    commitPriceQuantity(params){return post('/ebay/draft-listing-batch/update-price-and-quantity',params,_defaultLoading)},

    //批量操作
    //提交批量修改描述模板
    //获取模板可选项 getTpl(params)同上
    //提交修改的描述模板
    commitDraft_decsTpl(params){return post('/ebay/draft-listing-batch/update-desc-tpl',params)},//有问题需确认,无返回值
    //提交修改运输模板
    commitDraft_shipTpl(params){return post('/ebay/draft-listing-batch/update-shipping-tpl',params)},//有问题需确认,无返回值
    //提交修改退货模板
    commitDraft_returnTpl(params){return post('/ebay/draft-listing-batch/update-return-tpl',params)},//有问题需确认,无返回值
    //提交修改收款模板
    commitDraft_paymentTpl(params){return post('/ebay/draft-listing-batch/update-payment-tpl',params)},//有问题需确认,无返回值
    //提交批量修改标题
    commitBatchTitles(params){return post('/ebay/draft-listing-batch/update-title',params,_defaultLoading)},//有问题需确认,无返回值
    //提交批量修改 sa 刊登时间
    commitDraft_pubTime(params){return post('/ebay/goods/batch-edit-publish-time',params,_defaultLoading)},//有问题需确认,无返回值

    //批量删除draft listing
    destroy_draft(params){return post('/ebay/goods/destroy',params,_defaultLoading)},//有问题需确认,无返回值

    //批量刊登 draft listing
    //批量刊登前,会checkTitle
    draft_checkTitle(params){return post('/ebay/add/check-title',params)},  //有问题需确认,无返回值
    batch_publish(params){return post('/ebay/goods/batch-publish',params,_defaultLoading)},  //ids: 3365822 publishedDate: 2018-12-13 14:22:37 有问题需确认,无返回值
    //详细设置提交 批量刊登
    batch_publish_detail(params){return post('/ebay/goods/batch-publish-use-distribution',params,_defaultLoading)}, //有问题需确认,无返回值


    //多属性展开的后的价格修改
    draft_update_price(params){return post('/ebay/draft-listing-batch/update-price',params)},
    //列表中修改单个价格 with offer
    //get price with offer
    get_draft_price(params){return post('/ebay/goods/get-offer-for-draft',params)},
    draft_editPrice(params){return post('/ebay/draft-listing-batch/update-price-with-offer',params)},
    //列表中修改库存数量
    draft_editQuantity(params){return post('/ebay/draft-listing-batch/update-quantity',params)},



    // 3.拍卖循环列表页:-----------------------------------------------------------------------------------------------------------
    //草稿箱列表接口
    getloopTable(params){return get('/ebay/goods/loop-new',params,_defaultLoading)},
    // 操作开始暂停
    setisneedautoreList(params){return get('/ebay/add/setisneedautorelist',params)},

    // 修改duration，同修改持续售卖时间
    updateDuration(params){return get('/ebay/selling-listing-batch/update-duration',params)},

    // 每行查看
    getCycleLog(params){return get('/ebay/auction-cycle/get-cycle-log',params)},

    //  单个编辑循环次数
    updateCycleCount(params){return post('/ebay/auction-cycle/update-cycle-count',params)},

    //  批量编辑循环次数
    batchUpdateCycleCount(params){return post('/ebay/auction-cycle/batch-update-cycle-count',params,{
        json : true,
    })},

    //限价提示, 检验价格是否低于成本价
    verifyPrice(params){return post('/setting/suggest-price/verify-sku-limit-price',params,{
        json : true,
    })},

    // 4.价格库存队列列表页:-----------------------------------------------------------------------------------------------------------
    // 获取刊登人员
    getPriceListUsers(params){return get('/system/user/get-users',params)},
    // 价格库存队列
    getListByApis(params){return post('/ebay/queue/get-list-by-apis', JSON.stringify(params),{
        json : true,
        _loading: true
    })},
    // 价格库存队列的总数
    getListByApisTotal(params){return post('/ebay/queue/index-new-total', params)},
}